<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>实现RESOLVE和REJECT静态方法</title>
  </head>
  <body></body>
  <script src="js/Hd.js"></script>
  <script>
    let p = new Hd((resolve, reject) => {
      resolve("后盾人");
      reject("向边");
    });
    // Hd.resolve(p).then(
    //   (value) => {
    //     console.log(value);
    //   },
    //   (reason) => {
    //     console.log("error" + reason);
    //   }
    // );
    Hd.reject(p).then(
      (value) => {
        console.log(value);
      },
      (reason) => {
        console.log("error" + reason);
      }
    );
  </script>
</html>
